package IO流;

/**
 * @author:谢君臣
 * @Date:2021/5/18-15:46
 * @version:1.0
 * @function:
 */
public class lc137 {
    public int singleNumber(int[] nums) {
        int ans = 0;
        for (int i = 0; i < 32; i++) {
            int total = 0;
            for (int num : nums) {
                total += (num>>i&1);
            }
            if (total%3!=0){
                ans |= (1 << i);
            }
        }
        return ans;
    }
}
